{include file="common/mainHead"/}
<script src="__STATIC__/js/jquery.2.1.1.min.js"></script>
<script src="http://www.jq22.com/jquery/jquery-migrate-1.2.1.min.js"></script>
<script src="__STATIC__/js/jquery.jqprint.js"></script>
        <script language="javascript">
        function  a(){
        $("#printDiv").jqprint();
        }
        </script>
<div class="admin-main fadeInUp animated">
    <blockquote class="layui-elem-quote">
<a href="{:url('WebGoods/detailGood')}?id={$goodsid}" class="layui-btn">返回</a>
<a href="#" onclick="a()" class="layui-btn">打印</a>
<a href="#" onclick="getData('1')" class="layui-btn">已审核</a>
<!--<a href="#" onclick="getData('2')" class="layui-btn">驳回</a>-->
<a href="#" onclick="getData('-1')" class="layui-btn">全部</a>
        <a href="javascript:void(0);" onclick="remove()" class="layui-btn layui-btn-small">
            隐藏驳回
        </a>
        <a href="javascript:void(0);" onclick="showcz()" class="layui-btn layui-btn-small">
            显示驳回
        </a>
    </blockquote>
	<div id="printDiv">
    <fieldset class="layui-elem-field">
        <legend>拍卖资格审核</legend>
        <div class="layui-field-box table-responsive">
            <form class="layui-form layui-form-pane">
                <table class="layui-table table-hover">
                    <thead>
                    <tr>
                        <th>编号</th>
                        <th>用户名</th>
                        <th>电话号码</th>
                        <th>申请编号</th>
                        <!--<th>商品名称</th>-->
                        <th>申请时间</th>
                        <th>审核状态</th>
                        <th class="mycz">操作</th>
                    </tr>
                    </thead>
                    <!--内容容器-->
                    <tbody id="con">
                        <tr><td>反馈给你妇女解放拿货价格</td></tr>
                    </tbody>
                    <tfoot> <!--拍品名：  拍卖会时间：  拍卖公司：-->
                    <tr style="text-align: center;">
                        <td colspan="2" >拍品名：{$good_info['title']}</td>
                        <td colspan="2" >拍卖会时间：{$good_info['starttime']|date="y-m-d H:i:s",###}</td>
                        <td colspan="2" >拍卖公司：{$good_info['acut_company']}</td>
                    </tr>
                    <tr>
                        <td colspan="6">
                            <!--分页容器-->
                            <div id="paged" style="text-align: right"></div>
                        </td>
                    </tr>
                    </tfoot>
                </table>
            </form>
        </div>
    </fieldset>
	</div>
</div>
<!--模板-->
<script type="text/html" id="conTemp">
    {{# layui.each(d.list, function(index, item){ }}
    <tr>
        <td>{{ item.id }}</td>
        <td>{{ item.username }}</td>
        <td>{{ item.phone}}</td>
        <td>{{ item.usernumber }}</td>
        <!--<td>{{ item.title }}</td>-->
        <td>{{ getdate(item.cretime)}}</td>
        <td>
            {{# if(item.status==1){ }}
            <a class="red" href="javascript:" onclick="return stateyes('{{ item.id }}');" title="已审核">
                <div id="zt{{ item.id }}">
                    <button class="layui-btn layui-btn-warm layui-btn-mini">已审核</button>
                </div>
            </a>
            {{# }else{  }}
            <a class="red" href="javascript:" onclick="return stateyes('{{ item.id }}');" title="未审核">
                <div id="zt{{ item.id }}">
                    <button class="layui-btn layui-btn-danger layui-btn-mini">未审核</button>
                </div>
            </a>
            {{# } }}
        </td>
        <td class="mycz">
            <a href="javascript:;" onclick="return bohui({{item.id}})" data-id="1" data-opt="del" class="layui-btn layui-btn-danger layui-btn-mini">驳回</a>
        </td>
    </tr>
    {{# }); }}
</script>
{include file="common/mainFoot"/}
<script>
/**       
	   layui.config({
        base: '__ADMIN__/js/'
    }).use(['paging', 'code','icheck','layer'], function() {
        layui.code();
        var paging = layui.paging(),layer = parent.layer === undefined ? layui.layer : parent.layer;
        paging.init({
            url: "{:url('qualify')}", //地址
            elem: '#con', //内容容器
            params: {}, //发送到服务端的参数
            tempElem: '#conTemp', //模块容器
            pageConfig: { //分页参数配置
                elem: '#paged', //分页容器
                pageSize: 15 //分页大小
            },
            success: function() { //渲染成功的回调
                //alert('渲染成功');
            },
            fail: function(msg) { //获取数据失败的回调
                //alert('获取数据失败')
            },
            complate: function() { //完成的回调
                //alert('处理完成');
            }
        });
    });
	**/
	getData('-1');
	    function getData(state){
			layui.config({
        base: '__ADMIN__/js/'
    }).use(['paging', 'code','icheck','layer'], function() {
        layui.code();
        var paging = layui.paging(),layer = parent.layer === undefined ? layui.layer : parent.layer;
        paging.init({
            url: "{:url('index')}", //地址
            elem: '#con', //内容容器
            params: {
				  status:state
				}, //发送到服务端的参数
            tempElem: '#conTemp', //模块容器
            pageConfig: { //分页参数配置
                elem: '#paged', //分页容器
                pageSize: 15, //分页大小
            },
            success: function() { //渲染成功的回调
                //alert('渲染成功');
            },
            fail: function(msg) { //获取数据失败的回调
                //alert('获取数据失败')
            },
            complate: function() { //完成的回调
                //alert('处理完成');
            }
        });
    });
		}
        function getdate(date){
            var date = new Date(date*1000);//如果date为10位不需要乘1000
            var Y = date.getFullYear() + '-';
            var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
            var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
            var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
            var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
            var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());
            return Y+M+D+h+m+s;
        }

        function stateyes(id) {
            $.post('{:url("qualifyState")}', {id: id}, function (data) {
                if (data.status) {
                    if (data.info == '未审核') {
                        var a = '<button class="layui-btn layui-btn-danger layui-btn-mini">未审核</button>'
                        $('#zt' + id).html(a);
                        layer.msg(data.info, {icon: 5});
                        return false;
                    } else {
                        var b = '<button class="layui-btn layui-btn-warm layui-btn-mini">已审核</button>'
                        $('#zt' + id).html(b);
                        layer.msg(data.info, {icon: 6});
                        return false;
                    }
                }else{
                    layer.msg(data.msg,{time:1000,icon:2});
                    return false;
                }
            });
            return false;
        }
        function bohui(qualifyid) {
            layer.confirm('你确定要驳回吗？', {icon: 3}, function (index) {
                layer.close(index);
                window.location.href = "{:url('usersBohui')}?qualifyid=" + qualifyid;
            });
        }
        function remove() {
            $('.mycz').hide();
        }
        function showcz() {
            $('.mycz').show();
        }
</script>
